package com.nchu.student_score.controller;

import com.github.pagehelper.PageInfo;
import com.nchu.student_score.dataObject.TeachTaskResult;
import com.nchu.student_score.model.TeachTask;
import com.nchu.student_score.service.TeachService;
import com.nchu.student_score.vo.ResultVo;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/teach")
public class TeachController {
    @Resource
    TeachService teachService;

    @RequestMapping("getTeachTasks/{currPage}")
    public PageInfo<TeachTaskResult> getTeachTaskList(@RequestBody TeachTask input,@PathVariable Integer currPage){
        return teachService.getTeachTaskList(input,currPage);
    }

    @RequestMapping("updateTeachTask")
    public ResultVo<TeachTask> updateTeachTask(@RequestBody TeachTaskResult input){
        return teachService.insertTeachTask(input);
    }

    @RequestMapping("confirmTeachTask")//教师确认教学安排
    public ResultVo<TeachTask> confirmTeachTask(@RequestBody TeachTaskResult input){
        return teachService.confirmTeachTask(input);
    }
}
